<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta name="format-detection" content="telephone=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <title>价格纠错/分享</title>
    <link rel="stylesheet" type="text/css" href="../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="css/shareHistory.css">
    <link rel="stylesheet" type="text/css" href="../css/reset.css"/>
    <link rel="stylesheet" type="text/css" href="/js/mint-ui/mint-ui.css"/>
</head>
<body>
  <div id="shareHistory" class="main" v-cloak>
      <div class="search" id="search">
        <template v-if="searchOrError == 1">
          <div class="search-headerBox">
              <div class="search_header">
                  <img src="../image/member_fanhui.png"/>
                  <span><a href="./shareAndCorrection.html">返回</a></span>
                  <h2>分享历史记录</h2>
              </div>
              <div class="search-header">
                  <input type="text" placeholder="请输入商品名称" v-model="keyWorld">
                  <div class="search-header-img" @click="search">
                      <img src="../image/search.png"/>
                  </div>
              </div>
          </div>

          <div class="search-center">
              <ul v-infinite-scroll="loadMore"
              infinite-scroll-disabled="loading"
              infinite-scroll-distance="10">

                <li v-for="(item,index) in historylist" :key="item.correctId">
                  <div class="result-title"><p>{{item.createTime}}</p><span v-if="item.historyButtonType === 'RECALL'">价格审核中</span><span v-if="item.historyButtonType === 'CORRECT'">价格使用中</span><span v-if="item.historyButtonType === 'VIEW'"></span></div>
                  <div class="result-content">
                    <img :src="item.goodsImage">
                    <div class="result-right">
                      <h3>{{item.fullName}}</h3>
                      <p>价格：{{item.price}}元</p>
                      <span>超市：{{item.name}}</span>
                      <button v-if="item.historyButtonType === 'RECALL'" @click="revokePrice(index)">撤销价格</button>
                      <button v-else-if="item.historyButtonType === 'VIEW'" @click="viewPrice(index)">查看价格</button>
                      <button v-else-if="item.historyButtonType === 'CORRECT'" @click="errorCorrection(index)">价格纠错</button>
                    </div>
                  </div>
                </li>

              </ul>
          </div>
        </template>

        <div class="shareit" v-if="searchOrError == 2">
            <mt-actionsheet
                    :actions="actions"
                    v-model="priceTypeVisible">
            </mt-actionsheet>
            <mt-datetime-picker
                    type="datetime"
                    ref="picker"
                    :start-date="new Date()"
                    @confirm="handleConfirm">
            </mt-datetime-picker>
            <div class="shareit_header">
                <img src="../image/member_fanhui.png"/>
                <span @click="searchOrError=1">返回</span>
                <h2>价格纠错</h2>
            </div>
            <div class="shareit_center">
                <div class="shareit_center2">
                    <h3>价格类型:</h3>
                    <input type="text" @click="priceTypeVisible=true" v-model="priceType" id="price_center_input"
                           placeholder="请选择价格类型" style="width: 27%;"/>
                    <span></span>
                </div>
                <div class="shareit_center1" @click="showPicker(1)">
                    <h3>开始时间:</h3>
                    <p>{{params.startTime}}</p>

                    <span></span>
                </div>
                <div class="shareit_center1" @click="showPicker(2)">
                    <h3>结束时间:</h3>
                    <p>{{params.endTime}}</p>
                    <span></span>
                </div>
                <div class="shareit_center2">
                    <h3>纠错价格:</h3>
                    <input type="text" v-model="showPrice" placeholder="请输入价格元" style="width: 20%;"/>
                    <span></span>
                </div>
                <div class="shareit_center4">
                    <div class="shareit_center41">
                        <input type="file" id="priceImage" @change="showImage($event)" ref="file" multiple accept="image/*"/>
                        <img src="../image/price_plus.png"/>
                        <img :src="imageSrc" v-if="imageSrc" class="imagePrview"/>
                        <p>点击上传照片</p>
                        <button @click="submit">确认纠错</button>
                    </div>
                </div>
            </div>
        </div>

          <div class="popup-box">
            <div class="ui-mask" v-show="popShow"></div>
            <transition name="bottom-up">
              <div class="ui-pop" v-show="popShow">
                <div class="ui-pop-close" @click="close()"></div>
                <div class="ui-pop-conten">
                  <div class="pop-title"><span v-if="priceData.status === 'RECALL'">价格已撤销</span><span v-else-if="priceData.status === 'EXPIRED'">价格已过期</span><span v-else-if="priceData.status === 'AUDIT_FAIL'">价格审核失败</span></div>
                  <div>价格类型：{{priceData.priceTypeForCha}}</div>
                  <div>开始时间：{{priceData.strStartTime}}</div>
                  <div>结束时间：{{priceData.strEndTime}}</div>
                  <div>纠错价格：{{priceData.price}}元</div>
                </div>
              </div>
            </transition>
          </div>

      </div>

      <div class="toast-container" v-show="errMsg">
        <div class="toast"><span v-html="errMsg"></span></div>
      </div>
  </div>

  <script type="text/javascript" src="../js/vue.js"></script>
  <script src="../js/layout.js" type="text/javascript" charset="utf-8"></script>
  <!--<script src="../js/vue.min.js" type="text/javascript" charset="utf-8"></script>-->
  <script type="text/javascript" src="../js/axios.min.js"></script>
  <script type="text/javascript" src="/js/fetch20190612.js"></script>
  <script type="text/javascript" src="/js/mint-ui/mint-ui.js"></script>
  <script src="js/shareHistory20190509.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>
